<template>
	<div>
		<todo-top ></todo-top>
		<todo-body ></todo-body>
		<todo-footer></todo-footer>
	</div>
</template>

<script>
	import todoTop from './components/top'
	import todoBody from './components/body'
	import todoFooter from './components/footer.vue'
	import eventBus from './EventBus.js'
	export default {
		name : 'home',
		components :{
			todoTop,
			todoBody,
			todoFooter
		},
		created () {
			if(!localStorage.getItem("proceedArr") && !localStorage.getItem("finishArr")){

				let date = new Date ();
            	date.setHours (date.getHours () + 1);
            	let hour = date.getHours();
            	let minute = date.getMinutes();
            	let timerDate = "你需要在 "+hour +":"+  minute+" 的时候喝水啦~"
				const proceedArr = timerDate+',Daily reading,Go to the gym';
				localStorage.setItem("proceedArr",proceedArr);

				date.setHours (date.getHours () - 2);
            	hour = date.getHours();
				timerDate = "已在 "+hour +":"+  minute+" 的时候完成喝水的壮举~"

				const finishArr = "Get up early,"+timerDate;
				localStorage.setItem("finishArr",finishArr);	
					
			}

			
			
		},
		data () {
			return {
				// inputVal : ""
			}
		},
		methods : {
			// acceptVal (e) {
			// 	this.inputVal = e;
			// }
		}
	}
</script>